
-- Class: FleaStack
-- Wrap or subclass the class Group?
-- The best option would be to wrap Group then we can provide
-- a simple API; unfortunately it seems we miss a draw event
-- if we wrap, so we subclass.

FleaStack = Group:extend
{
	count = 0,

	-- topSprite
	topSprite = {},

	new = function (self, obj)
		obj = obj or {}
		self:extend(obj)
		if obj.onNew then obj:onNew() end
		return obj
	end,


	push = function (self, sprite)
		self.topSprite = sprite
		self.count = self.count + 1
		self:add(sprite)
	end,


	isTop = function (self, sprite)
		return sprite == self.topSprite
	end,



	-- Group doesn't respond to onCollide event

}

